function out = my_getFileObjWithRegexp(Dir,Pattern)
	% file_obj = my_getFileObjWithRegexp(Dir,Pattern)
	% ----- custom define function ------
	% Description: get file obj from dir, with regexp pattern
	% Input:
	%	Dir: path to dir of file
	%	Pattern: the regexp pattern of file name
	% Output:
	%	out: matlab file obj
	% Author: sid(cnqdcyq@163.com)
	% Date: 2022/1/4
	List = dir(Dir);
	NameCell = {List(3:end).name};
	out_reg = regexp(NameCell,Pattern,'Match');
	Index = ~cellfun(@isempty,out_reg);
	
	if ~any(Index) 
		error('No file matching the pattern found!');
	elseif sum(Index) > 1
		warning("Find File more than 1")
		out = List(find(Index)+2);
	else
		out = List(find(Index)+2);
	end
end
